package com.lovely3x.library.benas;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 平台对象
 * 用于分享和登录
 * Created by lovely3x on 16/8/26.
 */
public class Platform implements Parcelable {

    /**
     * 平台id
     */
    public String id;

    /**
     * 平台的名字
     */
    public String name;

    /**
     * 平台的图标
     */
    public int icon;

    public Platform() {
    }

    public Platform(String id, String name, int icon) {
        this.id = id;
        this.name = name;
        this.icon = icon;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.name);
        dest.writeInt(this.icon);
    }

    protected Platform(Parcel in) {
        this.id = in.readString();
        this.name = in.readString();
        this.icon = in.readInt();
    }

    public static final Parcelable.Creator<Platform> CREATOR = new Parcelable.Creator<Platform>() {
        @Override
        public Platform createFromParcel(Parcel source) {
            return new Platform(source);
        }

        @Override
        public Platform[] newArray(int size) {
            return new Platform[size];
        }
    };

    @Override
    public String toString() {
        return super.toString();
    }
}
